-
Notifications
You must be signed in to change notification settings - Fork 0
알림 보관함 페이지에서 톱니바퀴 연결시 알림페이지 설정 페이지 연결 #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
알림 보관함 페이지에서 톱니바퀴 연결시 알림페이지 설정 페이지 연결 #486
The head ref may contain hidden characters: "20260127_#452_\uC54C\uB9BC_\uBCF4\uAD00\uD568_\uD398\uC774\uC9C0\uC5D0\uC11C_\uD1B1\uB2C8\uBC14\uD034_\uC5F0\uACB0\uC2DC_\uC54C\uB9BC\uD398\uC774\uC9C0_\uC124\uC815_\uD398\uC774\uC9C0_\uC5F0\uACB0"
Conversation
Walkthrough알림 설정 타입과 설정 화면을 추가하고, 기존 알림 화면의 설정 탭을 새 설정 화면으로 네비게이션하도록 변경했습니다. 또한 worktree 관리 스크립트와 관련 문서들이 원격 브랜치 확인·생성 및 작업트리 루틴을 원격 인식 방식으로 대규모 리팩터링·기능 확장이 이루어졌습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant CLI as CLI/Script
participant Git as Git (local/remote)
participant FS as Filesystem
rect rgba(128, 203, 196, 0.5)
User->>CLI: 요청(브랜치 이름)
CLI->>Git: 로컬 브랜치 존재 여부 조회
Git-->>CLI: 로컬 없음
CLI->>Git: fetch origin
Git-->>CLI: origin 브랜치 존재 여부 응답
alt origin에 브랜치 존재
CLI->>Git: origin/branch에서 로컬 트래킹 브랜치 생성
else 원격에 없음
CLI->>Git: 현재 브랜치에서 새 로컬 브랜치 생성
end
CLI->>FS: worktree 경로 계산 및 디렉터리 준비
FS-->>CLI: 디렉터리 확인/생성 완료
CLI->>Git: worktree 추가(create/add)
Git-->>CLI: worktree 생성 성공
CLI->>User: 결과 출력 (경로/성공)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ 프로젝트 빌드 성공 APK 빌드가 완료되었습니다. |
…연결시_알림페이지_설정_페이지_연결' into 20260127_#452_알림_보관함_페이지에서_톱니바퀴_연결시_알림페이지_설정_페이지_연결
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.claude/scripts/worktree_manager.py:
- Line 3: The file has inconsistent version strings: the header "Git Worktree
Manager v1.1.0" and the docstring/metadata "Version: 1.0.4" differ; update the
latter to match the header (or vice versa) so both show the same version (e.g.,
change "Version: 1.0.4" to "Version: 1.1.0"). Locate the top banner "Git
Worktree Manager v1.1.0" and the docstring/metadata line containing "Version:
1.0.4" in worktree_manager.py and make them identical; also scan for any other
version constants or comments in the file and standardize them to the chosen
version.
In @.cursor/scripts/worktree_manager.py:
- Line 3: The docstring/version strings are inconsistent: the header string "Git
Worktree Manager v1.1.0" and the docstring line "Version: 1.0.4" differ; update
the docstring entry "Version: 1.0.4" to "Version: 1.1.0" (or vice versa if
v1.0.4 is the intended release) and scan the file for any other occurrences of
those version literals to keep them all consistent (look for the header "Git
Worktree Manager v1.1.0" and the docstring "Version: 1.0.4").
🧹 Nitpick comments (8)
.cursor/commands/init-workflow.md (1)
96-108:lines[i-1]접근 시 경계 조건 방어 코드 부재
i == 0일 경우lines[-1]에 접근하게 되어 잘못된 경로를 반환할 수 있습니다.git worktree list --porcelain출력 형식상branch줄이 첫 번째에 올 가능성은 낮지만, 문서 내 예시 코드이므로 방어 코드를 추가하면 더 안전합니다.🛡️ 제안
for i, line in enumerate(lines): if line.startswith(f'branch refs/heads/{branch_name}'): - worktree_path = lines[i-1].replace('worktree ', '') + if i > 0: + worktree_path = lines[i-1].replace('worktree ', '') break.cursor/scripts/worktree_manager.py (2)
260-265:lstrip('* ')는 문자열이 아닌 개별 문자를 제거합니다
lstrip('* ')는*,각각의 문자를 왼쪽에서 제거합니다. 예를 들어" special"→"pecial"이 됩니다. 현재 브랜치명 패턴(날짜 접두사)상 실질적 문제가 될 가능성은 낮지만, 의도대로라면 prefix 제거 방식을 사용하는 것이 정확합니다.🔧 수정 제안
- branches = [line.strip().lstrip('* ') for line in stdout.split('\n')] + branches = [line.strip().removeprefix('* ').strip() for line in stdout.split('\n')]
622-651:fetch_remote()실패 시에도remote_branch_exists를 호출합니다Line 628에서
fetch_remote()의 반환값을 무시하고 있어, fetch가 실패(네트워크 오류 등)해도 stale 데이터 기반으로 리모트 브랜치 존재 여부를 판단합니다. 이로 인해 실제로는 리모트에 존재하는 브랜치를 못 찾거나, 이미 삭제된 리모트 브랜치를 찾는 오동작이 발생할 수 있습니다.fetch 실패 시 경고 로그를 남기는 현재 동작도 나쁘지 않지만, 최소한 코멘트로 의도적 fallthrough임을 명시하면 좋겠습니다.
🔧 수정 제안
# 리모트에서 최신 정보 가져오기 - fetch_remote() + # fetch 실패 시에도 기존 캐시된 리모트 정보로 계속 진행 + fetch_remote() # best-effort; uses cached remote refs on failure.claude/scripts/worktree_manager.py (5)
1-22:.cursor/scripts/worktree_manager.py와 거의 동일한 코드 중복이 파일은
.cursor/scripts/worktree_manager.py와 들여쓰기(2-space vs 4-space)만 다르고 로직이 동일합니다. 700줄 이상의 코드가 두 곳에서 유지보수되어야 하므로 향후 변경 시 불일치가 발생할 위험이 높습니다.공통 모듈을 하나의 위치에 두고 두 환경에서 참조하거나, 심볼릭 링크를 사용하는 것을 고려해 주세요.
41-42:try-except-pass에서 예외가 무시됩니다Ruff S110에서 지적된 대로, 래핑 실패 시 예외를 완전히 무시하고 있습니다. 최소한
logging.debug등으로 남기면 디버깅에 도움이 됩니다.
444-448: 미사용 변수stdoutRuff RUF059에서 지적된 대로,
stdout이 사용되지 않습니다. 관례에 따라_로 대체하세요.🔧 수정 제안
- success, stdout, stderr = run_git_command( + success, _, stderr = run_git_command(
586-586: 플레이스홀더 없는 f-stringRuff F541에서 지적된 대로, Lines 586과 590에
f접두사가 불필요합니다.🔧 수정 제안
- print(f' $env:GIT_BRANCH_NAME = "브랜치명"') + print(' $env:GIT_BRANCH_NAME = "브랜치명"')- print(f' $env:BRANCH_NAME_FILE = "branch_name.txt"') + print(' $env:BRANCH_NAME_FILE = "branch_name.txt"')Also applies to: 590-590
186-193: 리스트 연결 방식 개선Ruff RUF005에서 제안한 대로,
['git'] + args대신['git', *args]가 더 관용적입니다.🔧 수정 제안
result = subprocess.run( - ['git'] + args, + ['git', *args], capture_output=True,
| # -*- coding: utf-8 -*- | ||
| """ | ||
| Git Worktree Manager v1.0.4 | ||
| Git Worktree Manager v1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring 내 버전 불일치 (.cursor 버전과 동일 이슈)
Line 3은 v1.1.0, Line 21은 Version: 1.0.4입니다. 통일이 필요합니다.
🔧 수정 제안
Author: Cursor AI Assistant
-Version: 1.0.4
+Version: 1.1.0Also applies to: 21-21
🤖 Prompt for AI Agents
In @.claude/scripts/worktree_manager.py at line 3, The file has inconsistent
version strings: the header "Git Worktree Manager v1.1.0" and the
docstring/metadata "Version: 1.0.4" differ; update the latter to match the
header (or vice versa) so both show the same version (e.g., change "Version:
1.0.4" to "Version: 1.1.0"). Locate the top banner "Git Worktree Manager v1.1.0"
and the docstring/metadata line containing "Version: 1.0.4" in
worktree_manager.py and make them identical; also scan for any other version
constants or comments in the file and standardize them to the chosen version.
| # -*- coding: utf-8 -*- | ||
| """ | ||
| Git Worktree Manager v1.0.4 | ||
| Git Worktree Manager v1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring 내 버전 불일치
Line 3에서는 v1.1.0으로 표시되지만, Line 21에서는 Version: 1.0.4로 남아 있습니다. 하나로 통일해야 합니다.
🔧 수정 제안
Author: Cursor AI Assistant
-Version: 1.0.4
+Version: 1.1.0
"""Also applies to: 21-21
🤖 Prompt for AI Agents
In @.cursor/scripts/worktree_manager.py at line 3, The docstring/version strings
are inconsistent: the header string "Git Worktree Manager v1.1.0" and the
docstring line "Version: 1.0.4" differ; update the docstring entry "Version:
1.0.4" to "Version: 1.1.0" (or vice versa if v1.0.4 is the intended release) and
scan the file for any other occurrences of those version literals to keep them
all consistent (look for the header "Git Worktree Manager v1.1.0" and the
docstring "Version: 1.0.4").
|
✅ 프로젝트 빌드 성공 APK 빌드가 완료되었습니다. |
|
✅ 프로젝트 빌드 성공 APK 빌드가 완료되었습니다. |
|
✅ 프로젝트 빌드 성공 APK 빌드가 완료되었습니다. |
SeoHyun1024
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@lib/screens/notification_settings_screen.dart`:
- Around line 38-58: In _loadNotificationSettings(), handle the case where
response.member is null so _isLoading is cleared; if response.member == null
(but the API call succeeded) call setState to set _isLoading = false and
optionally initialize the notification flags (_isMarketingEnabled,
_isActivityEnabled, _isChatEnabled, _isContentEnabled, _isTransactionEnabled) to
safe defaults, ensuring the mounted check and existing setState usage remain
consistent so the UI stops showing the loading spinner even when response.member
is null.
🧹 Nitpick comments (4)
lib/widgets/common/completed_toggle_switch.dart (1)
36-39: 기존 코드에서Colors.white및Colors.black직접 사용이번 변경과 직접 관련은 없지만, Line 36의
Colors.white와 Line 39의Colors.black.withAlpha(64)가AppColors상수 대신 직접 사용되고 있습니다. 코딩 가이드라인에 따라AppColors를 사용해야 합니다.♻️ AppColors 사용으로 변경 제안
- color: Colors.white, + color: AppColors.textColorWhite,As per coding guidelines, "Always use AppColors for colors; direct Color code usage is forbidden in Dart files".
lib/screens/notification_settings_screen.dart (2)
138-213:switch문이 3회 중복 사용됨 — Map 기반 접근으로 간소화 가능
_getSettingValue,_onSettingChanged,_updateNotificationSetting에서 동일한 switch 패턴이 반복됩니다. 설정 값을 Map으로 관리하면 코드 중복을 줄이고 새 설정 타입 추가 시 변경 포인트를 최소화할 수 있습니다.
188-212: API 실패 시 사용자에게 피드백 없음토글이 조용히 원복되기만 하면 사용자는 설정 변경 실패를 인지하기 어렵습니다. 스낵바 등으로 실패를 알려주는 것을 권장합니다.
lib/services/apis/member_api.dart (1)
244-273:late MemberResponse가onSuccess미호출 시LateInitializationError를 발생시킬 수 있음
sendMultipartRequest가 예외를 던지지 않으면서onSuccess도 호출하지 않는 경우(예: 4xx/5xx 응답),memberResponse가 초기화되지 않은 상태로 반환되어 런타임 에러가 발생합니다. 호출부(_updateNotificationSetting)에서try-catch로 감싸고 있어 즉시 크래시로 이어지진 않지만, 에러 원인 파악이 어려울 수 있습니다.기존 메서드(
getMemberInfo등)에도 동일한 패턴이 있으므로 향후 전체적으로 개선하는 것을 권장합니다.
| Future<void> _loadNotificationSettings() async { | ||
| try { | ||
| final response = await _memberApi.getMemberInfo(); | ||
| final Member? member = response.member; | ||
| if (member != null && mounted) { | ||
| setState(() { | ||
| _isMarketingEnabled = member.isMarketingInfoAgreed ?? false; | ||
| _isActivityEnabled = member.isActivityNotificationAgreed ?? false; | ||
| _isChatEnabled = member.isChatNotificationAgreed ?? false; | ||
| _isContentEnabled = member.isContentNotificationAgreed ?? false; | ||
| _isTransactionEnabled = member.isTradeNotificationAgreed ?? false; | ||
| _isLoading = false; | ||
| }); | ||
| } | ||
| } catch (e) { | ||
| debugPrint('알림 설정 로딩 실패: $e'); | ||
| if (mounted) { | ||
| setState(() => _isLoading = false); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
member가 null일 경우 로딩이 영원히 해제되지 않음
getMemberInfo()가 성공하지만 response.member가 null인 경우, _isLoading이 true로 유지되어 사용자에게 무한 로딩 스피너가 표시됩니다.
🐛 수정 제안
final Member? member = response.member;
- if (member != null && mounted) {
+ if (mounted) {
setState(() {
- _isMarketingEnabled = member.isMarketingInfoAgreed ?? false;
- _isActivityEnabled = member.isActivityNotificationAgreed ?? false;
- _isChatEnabled = member.isChatNotificationAgreed ?? false;
- _isContentEnabled = member.isContentNotificationAgreed ?? false;
- _isTransactionEnabled = member.isTradeNotificationAgreed ?? false;
+ if (member != null) {
+ _isMarketingEnabled = member.isMarketingInfoAgreed ?? false;
+ _isActivityEnabled = member.isActivityNotificationAgreed ?? false;
+ _isChatEnabled = member.isChatNotificationAgreed ?? false;
+ _isContentEnabled = member.isContentNotificationAgreed ?? false;
+ _isTransactionEnabled = member.isTradeNotificationAgreed ?? false;
+ }
_isLoading = false;
});
}🤖 Prompt for AI Agents
In `@lib/screens/notification_settings_screen.dart` around lines 38 - 58, In
_loadNotificationSettings(), handle the case where response.member is null so
_isLoading is cleared; if response.member == null (but the API call succeeded)
call setState to set _isLoading = false and optionally initialize the
notification flags (_isMarketingEnabled, _isActivityEnabled, _isChatEnabled,
_isContentEnabled, _isTransactionEnabled) to safe defaults, ensuring the mounted
check and existing setState usage remain consistent so the UI stops showing the
loading spinner even when response.member is null.
|
✅ 프로젝트 빌드 성공 APK 빌드가 완료되었습니다. |
Summary by CodeRabbit